package crypto

import (
	"fmt"
	"math/rand"
	"time"
)

func (cry *Crypto) Unix() int64 {
	return time.Now().UnixNano()
}

func (cry *Crypto) UnixMilli() int64 {
	return time.Now().UnixNano() / 1e6
}

func (cry *Crypto) RangeUnix() string {
	unix := cry.Unix()
	source := rand.NewSource(unix)
	now := rand.New(source)
	to := now.Intn(1000000)
	return fmt.Sprintf("%d_%d", unix, to)
}
